A database is a collection of stored data that is logically related and that is accessible by one or more users or applications. A popular type of database is the relational database management system (RDBMS), which includes relational tables, also referred to as relations, made up of rows and columns (also referred to as tuples and attributes). Each row represents an occurrence of an entity defined by a table, with an entity being a person, place, thing, or other object about which the table contains information.
One of the goals of a database management system is to optimize the performance of queries for access and manipulation of data stored in the database. Given a target environment, an optimal query plan is selected, with the optimal query plan being the one with the lowest cost, e.g., response time, as determined by an optimizer. The response time is the amount of time it takes to complete the execution of a query on a given system.
In computer systems featuring a plurality of storage devices, storage space of hard disks (HDDs), solid state storage devices (SSDs), or other storage medium, can be managed to ensure that the most frequently accessed data stays on the faster storage devices. One such system, Teradata Virtual Storage (TVS) by Teradata Corporation, attempts to achieve optimal system performance by placing the most frequently accessed data (hottest) in the locations with lowest average response time (fastest).
In a Teradata Database system, the Teradata Virtual Storage subsystem allocates storage for Teradata Access Module Processors (AMPs), described below, and identifies these units of storage, known as cylinders, by an identifier known as a cylinder identifier or cylinder ID. One component of this cylinder ID is an index field which, along with other fields in the cylinder ID, is used to logically identify the piece of storage. TVS may move the contents of the cylinder from one physical location to another, but will still refer to these contents by the same cylinder ID. The cylinder ID to physical location relationship is stored in a map on the disk where the cylinder currently resides. Algorithms in TVS attempt to keep the maximum index value as small as possible to limit the amount of memory required for lookup. Indexes can be reused when a cylinder is freed. The cylinder ID created from the re-used index may point to a cylinder on a different disk from the original cylinder.
This process works fine as long as all disks which might hold cylinders for an AMP are accessible during startup so that TVS can determine all of the cylinder ID indexes that are in-use for the AMP. If in-use indexes are not accounted for because a disk is missing, they may be reused and corruption will occur when the failed disk is returned to service because there will be duplicate cylinder IDs. Because of this, and the fact that other components of the Teradata Database system in addition to TVS have trouble starting up with cylinders missing, AMPs that might be affected by a missing disk are kept offline in a state known as “FATAL**” to prevent any allocations that might result in a duplicate cylinder ID index.
There is a desire to be able to startup the database system with some storage components missing. A method to prevent the assignment of duplicate cylinder ID indexes during startup is desired.
Simple solutions such as segregating cylinder IDs by device do not work because TVS can migrate cylinders between devices and the cylinder ID must not be changed when the cylinder is moved. A system for keeping track of the highest index allocated and using an increment above that when a disk is down has the problem of escalating values if there are multiple restarts while the device is missing, i.e., each restart will look at the highest index assigned and increment it to be safe and the incremented value becomes the new high value for the next restart. Maintaining a mirror copy of each disk's map on an alternate disk is another solution that may be desirable for other reasons, but it uses a large amount of disk space to hold the duplicate maps and also requires writes to both disks to write the modified map blocks when the map is updated. The invention described below provides a solution to the reuse and escalation problems discussed above without a mirrored map or significant memory or disk space overhead.
Teradata Virtual Storage, also referred to as Virtual Storage System (VSS), is described in U.S. Pat. Nos. 7,562,195 and 8,375,193, which are incorporated by reference herein.